<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.3.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"example.com","root":"/","scheme":"Muse","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.json"};
  </script>

  <meta name="description" content="​        以运动的小车为例，简单介绍卡尔曼滤波的五个公式的推导。推导过程使用了B站Up主https:&#x2F;&#x2F;space.bilibili.com&#x2F;352976834关于卡尔曼介绍的视频，讲的甚至比国外的一些视频教程更加通俗易懂，非常感谢他。 1.预测部分推导  2.更新部分  其中：Q和R是卡尔曼滤波器中主要需要调的东西。Q是过程噪声的方差，R是观测噪声的方差。 3.简单总结  4.具体pyt">
<meta property="og:type" content="article">
<meta property="og:title" content="运动小车中的卡尔曼滤波">
<meta property="og:url" content="http://example.com/2021/09/13/%E8%BF%90%E5%8A%A8%E5%B0%8F%E8%BD%A6%E4%B8%AD%E7%9A%84%E5%8D%A1%E5%B0%94%E6%9B%BC%E6%BB%A4%E6%B3%A2/index.html">
<meta property="og:site_name" content="学无止境">
<meta property="og:description" content="​        以运动的小车为例，简单介绍卡尔曼滤波的五个公式的推导。推导过程使用了B站Up主https:&#x2F;&#x2F;space.bilibili.com&#x2F;352976834关于卡尔曼介绍的视频，讲的甚至比国外的一些视频教程更加通俗易懂，非常感谢他。 1.预测部分推导  2.更新部分  其中：Q和R是卡尔曼滤波器中主要需要调的东西。Q是过程噪声的方差，R是观测噪声的方差。 3.简单总结  4.具体pyt">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信图片_20210911185400.jpg">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20210911213308.png">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20210912093920.png">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20210912203447.png">
<meta property="og:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20210912204944.png">
<meta property="article:published_time" content="2021-09-13T01:12:11.000Z">
<meta property="article:modified_time" content="2021-09-13T01:12:11.000Z">
<meta property="article:author" content="xudonglei">
<meta property="article:tag" content="卡尔曼滤波">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信图片_20210911185400.jpg">

<link rel="canonical" href="http://example.com/2021/09/13/%E8%BF%90%E5%8A%A8%E5%B0%8F%E8%BD%A6%E4%B8%AD%E7%9A%84%E5%8D%A1%E5%B0%94%E6%9B%BC%E6%BB%A4%E6%B3%A2/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>运动小车中的卡尔曼滤波 | 学无止境</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">学无止境</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">Do not bb, show me the example</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://example.com/2021/09/13/%E8%BF%90%E5%8A%A8%E5%B0%8F%E8%BD%A6%E4%B8%AD%E7%9A%84%E5%8D%A1%E5%B0%94%E6%9B%BC%E6%BB%A4%E6%B3%A2/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="xudonglei">
      <meta itemprop="description" content="搬砖 嵌入式">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          运动小车中的卡尔曼滤波
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2021-09-13 09:12:11" itemprop="dateCreated datePublished" datetime="2021-09-13T09:12:11+08:00">2021-09-13</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E7%AE%97%E6%B3%95/" itemprop="url" rel="index"><span itemprop="name">算法</span></a>
                </span>
            </span>

          
            <span id="/2021/09/13/%E8%BF%90%E5%8A%A8%E5%B0%8F%E8%BD%A6%E4%B8%AD%E7%9A%84%E5%8D%A1%E5%B0%94%E6%9B%BC%E6%BB%A4%E6%B3%A2/" class="post-meta-item leancloud_visitors" data-flag-title="运动小车中的卡尔曼滤波" title="阅读次数">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span class="leancloud-visitors-count"></span>
            </span>
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2021/09/13/%E8%BF%90%E5%8A%A8%E5%B0%8F%E8%BD%A6%E4%B8%AD%E7%9A%84%E5%8D%A1%E5%B0%94%E6%9B%BC%E6%BB%A4%E6%B3%A2/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2021/09/13/%E8%BF%90%E5%8A%A8%E5%B0%8F%E8%BD%A6%E4%B8%AD%E7%9A%84%E5%8D%A1%E5%B0%94%E6%9B%BC%E6%BB%A4%E6%B3%A2/" itemprop="commentCount"></span>
    </a>
  </span>
  
  

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p>​        以运动的小车为例，简单介绍卡尔曼滤波的五个公式的推导。推导过程使用了B站Up主<a target="_blank" rel="noopener" href="https://space.bilibili.com/352976834%E5%85%B3%E4%BA%8E%E5%8D%A1%E5%B0%94%E6%9B%BC%E4%BB%8B%E7%BB%8D%E7%9A%84%E8%A7%86%E9%A2%91%EF%BC%8C%E8%AE%B2%E7%9A%84%E7%94%9A%E8%87%B3%E6%AF%94%E5%9B%BD%E5%A4%96%E7%9A%84%E4%B8%80%E4%BA%9B%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B%E6%9B%B4%E5%8A%A0%E9%80%9A%E4%BF%97%E6%98%93%E6%87%82%EF%BC%8C%E9%9D%9E%E5%B8%B8%E6%84%9F%E8%B0%A2%E4%BB%96%E3%80%82">https://space.bilibili.com/352976834关于卡尔曼介绍的视频，讲的甚至比国外的一些视频教程更加通俗易懂，非常感谢他。</a></p>
<h3 id="1-预测部分推导"><a href="#1-预测部分推导" class="headerlink" title="1.预测部分推导"></a>1.预测部分推导</h3><img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信图片_20210911185400.jpg" style="zoom:37%;">

<h3 id="2-更新部分"><a href="#2-更新部分" class="headerlink" title="2.更新部分"></a>2.更新部分</h3><img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20210911213308.png" style="zoom:65%;">

<p><strong>其中：Q和R是卡尔曼滤波器中主要需要调的东西。Q是过程噪声的方差，R是观测噪声的方差。</strong></p>
<h3 id="3-简单总结"><a href="#3-简单总结" class="headerlink" title="3.简单总结"></a>3.简单总结</h3><img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20210912093920.png" style="zoom:67%;">

<h3 id="4-具体python代码例子"><a href="#4-具体python代码例子" class="headerlink" title="4.具体python代码例子"></a>4.具体python代码例子</h3><p>​        这边以匀速运动的小车为例，介绍python中filterpy.kalman的使用。</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">输入参数:</span><br><span class="line">x : ndarray (dim_x, <span class="number">1</span>), default = [<span class="number">0</span>,<span class="number">0</span>,<span class="number">0</span>…<span class="number">0</span>] 表示滤波器需要估计的状态向量</span><br><span class="line">P : ndarray (dim_x, dim_x), default eye(dim_x) 表示协方差矩阵</span><br><span class="line">Q : ndarray (dim_x, dim_x), default eye(dim_x) 表示过程噪声（系统噪声）</span><br><span class="line">R : ndarray (dim_z, dim_z), default eye(dim_x) 表示量测噪声</span><br><span class="line">H : ndarray (dim_z, dim_x) 表示量测方程</span><br><span class="line">F : ndarray (dim_x, dim_x) 表示状态转移方程</span><br><span class="line">B : ndarray (dim_x, dim_u), default <span class="number">0</span> 表示控制转移矩阵</span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">from</span> matplotlib <span class="keyword">import</span> pyplot <span class="keyword">as</span> plt</span><br><span class="line"><span class="keyword">import</span> numpy <span class="keyword">as</span> np</span><br><span class="line"><span class="keyword">from</span> filterpy.kalman <span class="keyword">import</span> KalmanFilter</span><br><span class="line"></span><br><span class="line"><span class="comment">######小车运动数据生成</span></span><br><span class="line"><span class="comment"># 生成100个位置，从1到100，是小车的实际位置</span></span><br><span class="line">z = np.linspace(<span class="number">1</span>,<span class="number">100</span>,<span class="number">100</span>)</span><br><span class="line"><span class="comment"># 添加噪声</span></span><br><span class="line">mu, sigma = <span class="number">0</span>, <span class="number">1</span></span><br><span class="line">noise = np.random.normal(mu, sigma, <span class="number">100</span>)</span><br><span class="line"><span class="comment"># 小车位置的观测值</span></span><br><span class="line">z_nosie = z+noise</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">##############参数初始化</span></span><br><span class="line"><span class="comment"># dim_x 状态向量size,在该例中为[p,v]，即位置和速度,size=2</span></span><br><span class="line"><span class="comment"># dim_z 测量向量size，假设小车为匀速，速度为1，测量向量只观测位置，size=1</span></span><br><span class="line">my_filter = KalmanFilter(dim_x=<span class="number">2</span>, dim_z=<span class="number">1</span>)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment"># 定义卡尔曼滤波中所需的参数</span></span><br><span class="line"><span class="comment"># x 初始状态为[0,0],即初始位置为0，速度为0.</span></span><br><span class="line"><span class="comment"># 这个初始值不是非常重要，在利用观测值进行更新迭代后会接近于真实值</span></span><br><span class="line">my_filter.x = np.array([<span class="number">0</span>, <span class="number">0</span>]).reshape(<span class="number">2</span>, <span class="number">1</span>)  <span class="comment"># 注意这里要reshape</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment"># p 协方差矩阵，表示状态向量内位置与速度的相关性</span></span><br><span class="line"><span class="comment"># 假设速度与位置没关系，协方差矩阵为[[1,0],[0,1]]</span></span><br><span class="line">my_filter.P = np.array([[<span class="number">1</span>, <span class="number">0</span>], [<span class="number">0</span>, <span class="number">1</span>]])</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment"># F 初始的状态转移矩阵，假设为匀速运动模型，可将其设为如下所示</span></span><br><span class="line">dt = <span class="number">1</span></span><br><span class="line">my_filter.F = np.array([[<span class="number">1</span>, dt], [<span class="number">0</span>, <span class="number">1</span>]])  <span class="comment"># shape为：(2，2)</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment"># Q 状态转移协方差矩阵，也就是外界噪声，因为它的形状默认是(dim_x, dim_x)</span></span><br><span class="line"><span class="comment"># 在该例中假设小车匀速，外界干扰小，所以我们对F非常确定，觉得F一定不会出错，所以Q设的很小</span></span><br><span class="line">my_filter.Q = np.array([[<span class="number">0.0001</span>, <span class="number">0</span>], [<span class="number">0.</span>, <span class="number">0.0001</span>]])</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment"># 观测矩阵 Hx = p</span></span><br><span class="line"><span class="comment"># 利用观测数据对预测进行更新，观测矩阵的左边一项不能设置成0</span></span><br><span class="line">my_filter.H = np.array([[<span class="number">1</span>, <span class="number">0</span>]])</span><br><span class="line"><span class="comment"># R 测量噪声，方差为1</span></span><br><span class="line">my_filter.R = <span class="number">1</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment"># 保存卡尔曼滤波过程中的位置和速度</span></span><br><span class="line">z_new_list = []</span><br><span class="line">v_new_list = []</span><br><span class="line"><span class="comment"># 对于每一个观测值，进行一次卡尔曼滤波</span></span><br><span class="line"><span class="keyword">for</span> k <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(z_nosie)):</span><br><span class="line">    <span class="comment"># 预测过程</span></span><br><span class="line">    my_filter.predict()</span><br><span class="line">    <span class="comment"># 利用观测值进行更新</span></span><br><span class="line">    my_filter.update(z_nosie[k])</span><br><span class="line">    <span class="comment"># do something with the output</span></span><br><span class="line">    x = my_filter.x</span><br><span class="line">    <span class="comment"># 收集卡尔曼滤波后的速度和位置信息</span></span><br><span class="line">    z_new_list.append(x[<span class="number">0</span>][<span class="number">0</span>])</span><br><span class="line">    v_new_list.append(x[<span class="number">1</span>][<span class="number">0</span>])</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">plt.subplot(<span class="number">111</span>)</span><br><span class="line">plt.plot(z_new_list, <span class="string">&#x27;r&#x27;</span>, linewidth=<span class="number">1</span>)</span><br><span class="line">plt.plot(z, <span class="string">&#x27;b&#x27;</span>, linewidth=<span class="number">1</span>)</span><br><span class="line">plt.plot(z_nosie, <span class="string">&#x27;g&#x27;</span>, linewidth=<span class="number">1</span>)</span><br><span class="line">plt.show()</span><br></pre></td></tr></table></figure>
<img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/微信截图_20210912203447.png" style="zoom:39%;">

<p><img src="https://xdl-blog-picture.oss-cn-shanghai.aliyuncs.com/img/%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20210912204944.png"></p>
<p>​        卡尔曼滤波后的红色那线和观测值相差比较远，因为测量噪声my_filter.R比外界噪声my_filter.Q大很多，肯定不会信任测量值。</p>

    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/%E5%8D%A1%E5%B0%94%E6%9B%BC%E6%BB%A4%E6%B3%A2/" rel="tag"># 卡尔曼滤波</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2021/09/13/%E4%BB%8E%E5%B7%A5%E7%A8%8B%E8%A7%92%E5%BA%A6%E5%AD%A6%E4%B9%A0%E5%8D%A1%E5%B0%94%E6%9B%BC%E6%BB%A4%E6%B3%A2/" rel="prev" title="从工程角度学习卡尔曼滤波">
      <i class="fa fa-chevron-left"></i> 从工程角度学习卡尔曼滤波
    </a></div>
      <div class="post-nav-item">
    <a href="/2021/09/16/arm-none-eabi-gcc%20is%20not%20able%20to%20compile%20a%20simple%20test%20program/" rel="next" title="arm-none-eabi-gcc is not able to compile a simple test program">
      arm-none-eabi-gcc is not able to compile a simple test program <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          
    <div class="comments" id="valine-comments"></div>

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-%E9%A2%84%E6%B5%8B%E9%83%A8%E5%88%86%E6%8E%A8%E5%AF%BC"><span class="nav-number">1.</span> <span class="nav-text">1.预测部分推导</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-%E6%9B%B4%E6%96%B0%E9%83%A8%E5%88%86"><span class="nav-number">2.</span> <span class="nav-text">2.更新部分</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-%E7%AE%80%E5%8D%95%E6%80%BB%E7%BB%93"><span class="nav-number">3.</span> <span class="nav-text">3.简单总结</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-%E5%85%B7%E4%BD%93python%E4%BB%A3%E7%A0%81%E4%BE%8B%E5%AD%90"><span class="nav-number">4.</span> <span class="nav-text">4.具体python代码例子</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">xudonglei</p>
  <div class="site-description" itemprop="description">搬砖 嵌入式</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">283</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">19</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">67</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2024</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">xudonglei</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://muse.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Muse</a> 强力驱动
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/muse.js"></script>


<script src="/js/next-boot.js"></script>




  




  
<script src="/js/local-search.js"></script>













  

  


<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
  NexT.utils.getScript('//unpkg.com/valine/dist/Valine.min.js', () => {
    var GUEST = ['nick', 'mail', 'link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item => {
      return GUEST.includes(item);
    });
    new Valine({
      el         : '#valine-comments',
      verify     : false,
      notify     : false,
      appId      : 'BT0Qw9HcTpPv1a6cT1iDBXKz-gzGzoHsz',
      appKey     : 'LMCMh8v02JTMFAwKNRcgoizI',
      placeholder: "Just go go",
      avatar     : 'mm',
      meta       : guest,
      pageSize   : '10' || 10,
      visitor    : true,
      lang       : 'zh-CN' || 'zh-cn',
      path       : location.pathname,
      recordIP   : false,
      serverURLs : ''
    });
  }, window.Valine);
});
</script>

</body>
</html>
